home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 May
/
Ahoy_Magazine_87-05_1987_Double_L_Side_B.d64
/
smooth curve.txt
< prev
next >
Wrap
Text File
|
2022-10-26
|
2KB
|
74 lines
SMOOTH CURVES
by Richard Bain
For those of you interested in this
program without needing to know its
history, smooth'curve is an advanced
connect the dots program. It draws a
line between all the points entered
by the user, in the same order as
they were entered. However, instead
of drawing a straight line between
the points, it uses an advanced
mathematical technique know as cubic
splines to draw as smooth a curve as
possible.
To demonstrate this, a fun drawing
program is on this disk. Use the
cursor keys to move a pointer around
the graphics screen. Press <RETURN>
for each point in the path to be
drawn. When all points are entered,
press <space> to start drawing the
curve.
Smooth'curve was originally a Fortran
program that was translated to Pascal
and then to COMAL. The Pascal
version, along with a 6 page article
with pictures, is in PC Tech Journal,
August 1986. Those of you with access
to that magazine may be surprised at
how close the COMAL and Pascal
listings actually are. There are only
two major differences. First, the
Pascal version has all the procedures
listed before the main section of the
program. COMAL can be written this
way, but most COMAL programmers
prefer to put the main section of the
program before the procedures. The
second main difference is in the
names of the keywords used in the
graphics commands.
COMAL 0.14 has two more differences
from the Pascal version. COMAL 0.14
doesn't allow for nested procedures
or the passing of arrays by value.
Therefore, procedures nested in the
Pascal version have been moved
outside in the COMAL 0.14 version.
The procedure headers were also
changed to make all arrays passed by
reference. These two changes were not
needed in COMAL 2.0. Even with these
minor changes, the structure of both
the COMAL and Pascal versions of
smooth'curve are the same.
Further Reference:
Smooth Curves
by Michael A. Covington
page 110, August 1986
PC Tech Journal
The World Trade Center
Suite 211
Baltimore, MD 21202
$29.97 per year subscription.